<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>合并两个数组，并排序</title>
	</head>
	<body>
		<script type="text/javascript">
			var arr1 = [5, 73, 43, 22, 80];
			var arr2 = [66, 35, 16, 2, 59];
			// 使用 concat() 方法合并数组
			var res = arr1.concat(arr2)
			console.log(res)
			
			// 使用冒泡排序
			for(let i = 0; i < res.length; i++) {
				for(let j = 0; j < res.length - i; j++) {
					if(res[j] > res[j + 1]) {
						const sum = res[j + 1]
						res[j + 1] = res[j]
						res[j] = sum
					}
				}
			}
			console.log(res)
		</script>
	</body>
</html>
